package ar.edu.unq.wannaplay.utils;

import org.apache.wicket.markup.html.link.Link;

import ar.edu.unq.wannaplay.pages.WPPage;

public class WPLink extends Link<Object> {

    private static final long serialVersionUID = 1L;

    private Class<? extends WPPage> classToResponse;

    public WPLink(final String id, final Class<? extends WPPage> clazz) {
        super(id);
        classToResponse = clazz;

    }

    @Override
    public void onClick() {
        this.setResponsePage(this.getClassToResponse());
    }

    public Class<? extends WPPage> getClassToResponse() {
        return classToResponse;
    }

    public void setClassToResponse(final Class<? extends WPPage> classToResponse) {
        this.classToResponse = classToResponse;
    }

}
